/** The Web UI Theme-v2.1.0 */
;layui.define("view", function(e) {
    function t(e) {
        e.attr("lay-id");
        var a = e.attr("lay-attr")
          , t = e.index();
        _.tabsBodyChange(t, {
            url: a,
            title: e.children("span").text()
        })
    }
    var o = layui.jquery
      , s = layui.laytpl
      , a = layui.table
      , i = layui.element
      , l = layui.util
      , n = layui.upload
      , r = (layui.form,
    layui.setter)
      , u = layui.view
      , d = layui.device()
      , c = o(window)
      , y = o(document)
      , m = o("body")
      , f = o("#" + r.container)
      , h = "layui-show"
      , p = "layui-this"
      , b = "layui-disabled"
      , v = "#LAY_app_body"
      , g = "LAY_app_flexible"
      , x = "layadmin-layout-tabs"
      , C = "layadmin-side-spread-sm"
      , k = "layadmin-tabsbody-item"
      , P = "layui-icon-shrink-right"
      , F = "layui-icon-spread-left"
      , A = "layadmin-side-shrink"
      , _ = {
        v: "2.1.0",
        mode: "iframe",
        req: u.req,
        exit: u.exit,
        escape: l.escape,
        on: function(e, a) {
            return layui.onevent.call(this, r.MOD_NAME, e, a)
        },
        sendAuthCode: function(i) {
            function l(e) {
                --n < 0 ? (t.removeClass(b).html("\u83b7\u53d6\u9a8c\u8bc1\u7801"),
                n = i.seconds,
                clearInterval(a)) : t.addClass(b).html(n + "\u79d2\u540e\u91cd\u83b7"),
                e || (a = setInterval(function() {
                    l(!0)
                }, 1e3))
            }
            var a, n = (i = o.extend({
                seconds: 60,
                elemPhone: "#LAY_phone",
                elemVercode: "#LAY_vercode"
            }, i)).seconds, t = o(i.elem);
            i.elemPhone = o(i.elemPhone),
            i.elemVercode = o(i.elemVercode),
            t.on("click", function() {
                var a, e = i.elemPhone, t = e.val();
                if (n === i.seconds && !o(this).hasClass(b)) {
                    if (!/^1\d{10}$/.test(t))
                        return e.focus(),
                        layer.msg("\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u624b\u673a\u53f7");
                    "object" == typeof i.ajax && (a = i.ajax.success,
                    delete i.ajax.success),
                    _.req(o.extend(!0, {
                        url: "/auth/code",
                        type: "get",
                        data: {
                            phone: t
                        },
                        success: function(e) {
                            layer.msg("\u9a8c\u8bc1\u7801\u5df2\u53d1\u9001\u81f3\u4f60\u7684\u624b\u673a\uff0c\u8bf7\u6ce8\u610f\u67e5\u6536", {
                                icon: 1,
                                shade: 0
                            }),
                            i.elemVercode.focus(),
                            l(),
                            a && a(e)
                        }
                    }, i.ajax))
                }
            })
        },
        screen: function() {
            var e = c.width();
            return 1200 < e ? 3 : 992 < e ? 2 : 768 < e ? 1 : 0
        },
        sideFlexible: function(e) {
            var a = f
              , t = o("#" + g)
              , i = _.screen();
            "spread" === e ? (t.removeClass(F).addClass(P),
            i < 2 ? a.addClass(C) : a.removeClass(C),
            a.removeClass(A)) : (t.removeClass(P).addClass(F),
            i < 2 ? a.removeClass(A) : a.addClass(A),
            a.removeClass(C)),
            layui.event.call(this, r.MOD_NAME, "side({*})", {
                status: e
            })
        },
        popup: u.popup,
        popupRight: function(e) {
            return _.popup.index = layer.open(o.extend({
                type: 1,
                id: "LAY_adminPopupR",
                anim: -1,
                title: !1,
                closeBtn: !1,
                offset: "r",
                shade: .1,
                shadeClose: !0,
                skin: "layui-anim layui-anim-rl layui-layer-adminRight",
                area: "300px"
            }, e))
        },
        theme: function(e) {
            r.theme;
            var t = layui.data(r.tableName)
              , a = "LAY_layadmin_theme"
              , i = document.createElement("style")
              , l = s([".layui-side-menu,", ".layui-layer-admin .layui-layer-title,", ".layadmin-side-shrink .layui-side-menu .layui-nav>.layui-nav-item>.layui-nav-child", "{background-color:{{d.color.main}} !important;}", ".layadmin-pagetabs .layui-tab-title li:after,", ".layadmin-pagetabs .layui-tab-title li.layui-this:after,", ".layui-nav-tree .layui-this,", ".layui-nav-tree .layui-this>a,", ".layui-nav-tree .layui-nav-child dd.layui-this,", ".layui-nav-tree .layui-nav-child dd.layui-this a,", ".layui-nav-tree .layui-nav-bar", "{background-color:{{d.color.selected}} !important;}", ".layadmin-pagetabs .layui-tab-title li:hover,", ".layadmin-pagetabs .layui-tab-title li.layui-this", "{color: {{d.color.selected}} !important;}", ".layui-layout-admin .layui-logo{background-color:{{d.color.logo || d.color.main}} !important;}", "{{# if(d.color.header){ }}", ".layui-layout-admin .layui-header{background-color:{{ d.color.header }};}", ".layui-layout-admin .layui-header a,", ".layui-layout-admin .layui-header a cite{color: #f8f8f8;}", ".layui-layout-admin .layui-header a:hover{color: #fff;}", ".layui-layout-admin .layui-header .layui-nav .layui-nav-more{border-top-color: #fbfbfb;}", ".layui-layout-admin .layui-header .layui-nav .layui-nav-mored{border-color: transparent; border-bottom-color: #fbfbfb;}", ".layui-layout-admin .layui-header .layui-nav .layui-this:after, .layui-layout-admin .layui-header .layui-nav-bar{background-color: #fff; background-color: rgba(255,255,255,.5);}", ".layadmin-pagetabs .layui-tab-title li:after{display: none;}", "{{# } }}"].join("")).render(e = o.extend({}, t.theme, e))
              , n = document.getElementById(a);
            "styleSheet"in i ? (i.setAttribute("type", "text/css"),
            i.styleSheet.cssText = l) : i.innerHTML = l,
            i.id = a,
            n && m[0].removeChild(n),
            m[0].appendChild(i),
            m.attr("layadmin-themealias", e.color.alias),
            t.theme = t.theme || {},
            layui.each(e, function(e, a) {
                t.theme[e] = a
            }),
            layui.data(r.tableName, {
                key: "theme",
                value: t.theme
            })
        },
        initTheme: function(e) {
            var a = r.theme;
            a.color[e = e || 0] && (a.color[e].index = e,
            _.theme({
                color: a.color[e]
            }))
        },
        tabsPage: {},
        tabsBody: function(e) {
            return o(v).find("." + k).eq(e || 0)
        },
        tabsBodyChange: function(e, a) {
            a = a || {},
            _.tabsBody(e).addClass(h).siblings().removeClass(h),
            T.rollPage("auto", e),
            _.recordURL(a),
            layui.event.call(this, r.MOD_NAME, "tabsPage({*})", a)
        },
        recordURL: function(e) {
            var a;
            (r.record || {}).url && e.url && (/^(\w*:)*\/\/.+/.test(e.url) && (e.url = ""),
            location.hash = _.correctRouter(e.url),
            e.url && e.title && ((a = {})[e.url] = e.title,
            layui.data(r.tableName, {
                key: "record",
                value: a
            })))
        },
        resize: function(e) {
            var a = layui.router().path.join("-");
            _.resizeFn[a] && (c.off("resize", _.resizeFn[a]),
            delete _.resizeFn[a]),
            "off" !== e && (e(),
            _.resizeFn[a] = e,
            c.on("resize", _.resizeFn[a]))
        },
        resizeFn: {},
        runResize: function() {
            var e = layui.router().path.join("-");
            _.resizeFn[e] && _.resizeFn[e]()
        },
        delResize: function() {
            this.resize("off")
        },
        closeThisTabs: function() {
            _.tabsPage.index && o(z).eq(_.tabsPage.index).find(".layui-tab-close").trigger("click")
        },
        fullScreen: function() {
            var e = document.documentElement
              , a = e.requestFullscreen || e.webkitRequestFullScreen || e.mozRequestFullScreen || e.msRequestFullscreen;
            void 0 !== a && a && a.call(e)
        },
        exitScreen: function() {
            document.documentElement;
            document.exitFullscreen ? document.exitFullscreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitCancelFullScreen ? document.webkitCancelFullScreen() : document.msExitFullscreen && document.msExitFullscreen()
        },
        correctRouter: function(e) {
            return (e = /^\//.test(e) ? e : "/" + e).replace(/^(\/+)/, "/").replace(new RegExp("/" + r.entry + "$"), "/")
        }
    }
      , T = _.events = {
        flexible: function(e) {
            e = e.find("#" + g).hasClass(F);
            _.sideFlexible(e ? "spread" : null)
        },
        refresh: function() {
            var e = o("." + k).length;
            _.tabsPage.index >= e && (_.tabsPage.index = e - 1),
            _.tabsBody(_.tabsPage.index).find(".layadmin-iframe")[0].contentWindow.location.reload(!0)
        },
        serach: function(t) {
            t.off("keypress").on("keypress", function(e) {
                var a;
                this.value.replace(/\s/g, "") && 13 === e.keyCode && (e = t.attr("lay-action"),
                a = t.attr("lay-title") || t.attr("lay-text") || "\u641c\u7d22",
                e += this.value,
                a = a + ": " + _.escape(this.value),
                _.openTabsPage({
                    url: e,
                    title: a,
                    highlight: "color: #FF5722;"
                }),
                T.serach.keys || (T.serach.keys = {}),
                T.serach.keys[_.tabsPage.index] = this.value,
                this.value === T.serach.keys[_.tabsPage.index] && T.refresh(t),
                this.value = "")
            })
        },
        message: function(e) {
            e.find(".layui-badge-dot").remove()
        },
        theme: function() {
            _.popupRight({
                id: "LAY_adminPopupTheme",
                success: function() {
                    u(this.id).render("theme")
                }
            })
        },
        note: function(e) {
            var a = _.screen() < 2
              , t = layui.data(r.tableName).note;
            T.note.index = _.popup({
                title: "\u672c\u5730\u4fbf\u7b7e",
                shade: 0,
                offset: ["41px", a ? null : e.offset().left - 250 + "px"],
                anim: -1,
                id: "LAY_adminNote",
                skin: "layadmin-note layui-anim layui-anim-upbit",
                content: '<textarea placeholder="\u5185\u5bb9"></textarea>',
                resize: !1,
                success: function(e, a) {
                    e.find("textarea").val(void 0 === t ? "\u4fbf\u7b7e\u4e2d\u7684\u5185\u5bb9\u4f1a\u5b58\u50a8\u5728\u672c\u5730\uff0c\u8fd9\u6837\u5373\u4fbf\u4f60\u5173\u6389\u4e86\u6d4f\u89c8\u5668\uff0c\u5728\u4e0b\u6b21\u6253\u5f00\u65f6\uff0c\u4f9d\u7136\u4f1a\u8bfb\u53d6\u5230\u4e0a\u4e00\u6b21\u7684\u8bb0\u5f55\u3002\u662f\u4e2a\u975e\u5e38\u5c0f\u5de7\u5b9e\u7528\u7684\u672c\u5730\u5907\u5fd8\u5f55" : t).focus().on("keyup", function() {
                        layui.data(r.tableName, {
                            key: "note",
                            value: this.value
                        })
                    })
                }
            })
        },
        fullscreen: function(e, a) {
            function t(e) {
                e ? n.addClass(l).removeClass(i) : n.addClass(i).removeClass(l)
            }
            var i = "layui-icon-screen-full"
              , l = "layui-icon-screen-restore"
              , n = e.children("i")
              , e = n.hasClass(i);
            if (a)
                return t(a.status);
            t(e),
            e ? _.fullScreen() : _.exitScreen()
        },
        about: function() {
            _.popupRight({
                id: "LAY_adminPopupAbout",
                success: function() {
                    u(this.id).render("about")
                }
            })
        },
        more: function() {
            _.popupRight({
                id: "LAY_adminPopupMore",
                success: function() {
                    u(this.id).render("more")
                }
            })
        },
        back: function() {
            history.back()
        },
        setTheme: function(e) {
            var a = e.data("index");
            e.siblings(".layui-this").data("index");
            e.hasClass(p) || (e.addClass(p).siblings(".layui-this").removeClass(p),
            _.initTheme(a),
            u("LAY_adminPopupTheme").render("theme"))
        },
        rollPage: function(e, a) {
            var t, i = o("#LAY_app_tabsheader"), l = i.children("li"), n = (i.prop("scrollWidth"),
            i.outerWidth()), s = parseFloat(i.css("left"));
            if ("left" === e)
                !s && s <= 0 || (t = -s - n,
                l.each(function(e, a) {
                    a = o(a).position().left;
                    if (t <= a)
                        return i.css("left", -a),
                        !1
                }));
            else if ("auto" === e) {
                var r, e = l.eq(a);
                if (e[0]) {
                    if ((a = e.position().left) < -s)
                        return void i.css("left", -a);
                    a + e.outerWidth() >= n - s && (r = a + e.outerWidth() - (n - s),
                    l.each(function(e, a) {
                        a = o(a).position().left;
                        if (0 < a + s && r < a - s)
                            return i.css("left", -a),
                            !1
                    }))
                }
            } else
                l.each(function(e, a) {
                    var a = o(a)
                      , t = a.position().left;
                    if (t + a.outerWidth() >= n - s)
                        return i.css("left", -t),
                        !1
                })
        },
        leftPage: function() {
            T.rollPage("left")
        },
        rightPage: function() {
            T.rollPage()
        },
        closeThisTabs: function() {
            (parent === self ? _ : parent.layui.admin).closeThisTabs()
        },
        closeOtherTabs: function(e) {
            var t = "LAY-system-pagetabs-remove";
            "all" === e ? (o(z + ":gt(0)").remove(),
            o(v).find("." + k + ":gt(0)").remove(),
            o(z).eq(0).trigger("click")) : (o(z).each(function(e, a) {
                e && e != _.tabsPage.index && (o(a).addClass(t),
                _.tabsBody(e).addClass(t))
            }),
            o("." + t).remove())
        },
        closeAllTabs: function() {
            T.closeOtherTabs("all")
        },
        shade: function() {
            _.sideFlexible()
        },
        im: function() {
            _.popup({
                id: "LAY-popup-layim-demo",
                shade: 0,
                area: ["800px", "300px"],
                title: "\u9762\u677f\u5916\u7684\u64cd\u4f5c\u793a\u4f8b",
                offset: "lb",
                success: function() {
                    layui.view(this.id).render("layim/demo").then(function() {
                        layui.use("im")
                    })
                }
            })
        }
    }
      , z = ("pageTabs"in layui.setter || (layui.setter.pageTabs = !0),
    r.pageTabs || (o("#LAY_app_tabs").addClass("layui-hide"),
    f.addClass("layadmin-tabspage-none")),
    d.ie && d.ie < 10 && u.error("IE" + d.ie + "\u4e0b\u8bbf\u95ee\u53ef\u80fd\u4e0d\u4f73\uff0c\u63a8\u8350\u4f7f\u7528\uff1aChrome / Firefox / Edge \u7b49\u9ad8\u7ea7\u6d4f\u89c8\u5668", {
        offset: "auto",
        id: "LAY_errorIE"
    }),
    (l = layui.data(r.tableName)).theme ? _.theme(l.theme) : r.theme && _.initTheme(r.theme.initColorIndex),
    i.on("tab(" + x + ")", function(e) {
        _.tabsPage.index = e.index
    }),
    _.on("tabsPage(setMenustatus)", function(e) {
        function n(e) {
            return {
                list: e.children(".layui-nav-child"),
                a: e.children("*[lay-href]")
            }
        }
        var s = e.url
          , e = o("#LAY-system-side-menu")
          , r = "layui-nav-itemed";
        e.find("." + p).removeClass(p),
        _.screen() < 2 && _.sideFlexible(),
        e.children("li").each(function(e, a) {
            var a = o(a)
              , t = n(a)
              , i = t.list.children("dd")
              , l = s === t.a.attr("lay-href");
            if (i.each(function(e, a) {
                var a = o(a)
                  , t = n(a)
                  , i = t.list.children("dd")
                  , l = s === t.a.attr("lay-href");
                if (i.each(function(e, a) {
                    var a = o(a)
                      , t = n(a);
                    if (s === t.a.attr("lay-href"))
                        return t = t.list[0] ? r : p,
                        a.addClass(t).siblings().removeClass(t),
                        !1
                }),
                l)
                    return i = t.list[0] ? r : p,
                    a.addClass(i).siblings().removeClass(i),
                    !1
            }),
            l)
                return i = t.list[0] ? r : p,
                a.addClass(i).siblings().removeClass(i),
                !1
        })
    }),
    i.on("nav(layadmin-system-side-menu)", function(e) {
        e.siblings(".layui-nav-child")[0] && f.hasClass(A) && (_.sideFlexible("spread"),
        layer.close(e.data("index"))),
        _.tabsPage.type = "nav"
    }),
    i.on("nav(layadmin-pagetabs-nav)", function(e) {
        e = e.parent();
        e.removeClass(p),
        e.parent().removeClass(h)
    }),
    "#LAY_app_tabsheader>li")
      , L = (m.on("click", z, function() {
        var e = o(this)
          , a = e.index();
        _.tabsPage.type = "tab",
        _.tabsPage.index = a,
        t(e)
    }),
    i.on("tabDelete(" + x + ")", function(e) {
        var a = o(z + ".layui-this");
        e.index && _.tabsBody(e.index).remove(),
        t(a),
        _.delResize()
    }),
    m.on("click", "*[lay-href]", function() {
        var e = o(this)
          , a = e.attr("lay-href")
          , t = e.attr("lay-title") || e.attr("lay-text") || e.text();
        _.tabsPage.elem = e,
        (parent === self ? layui : top.layui).admin.openTabsPage({
            url: a,
            title: t
        }),
        r.refreshCurrPage && a === _.tabsBody(_.tabsPage.index).find("iframe").attr("src") && _.events.refresh()
    }),
    m.on("click", "*[layadmin-event]", function() {
        var e = o(this)
          , a = e.attr("layadmin-event");
        T[a] && T[a].call(this, e)
    }),
    m.on("mouseenter", "*[lay-tips]", function() {
        var t, e, a, i = o(this);
        i.parent().hasClass("layui-nav-item") && !f.hasClass(A) || (a = i.attr("lay-tips"),
        t = i.attr("lay-offset"),
        e = i.attr("lay-direction"),
        a = layer.tips(a, this, {
            tips: e || 1,
            time: -1,
            success: function(e, a) {
                t && e.css("margin-left", t + "px")
            }
        }),
        i.data("index", a))
    }).on("mouseleave", "*[lay-tips]", function() {
        layer.close(o(this).data("index"))
    }),
    layui.data.resizeSystem = function() {
        layer.closeAll("tips"),
        L.lock || setTimeout(function() {
            _.sideFlexible(_.screen() < 2 ? "" : "spread"),
            delete L.lock
        }, 100),
        L.lock = !0
    }
    );
    c.on("resize", layui.data.resizeSystem),
    y.on("fullscreenchange", function() {
        T.fullscreen(o('[layadmin-event="fullscreen"]'), {
            status: document.fullscreenElement
        })
    }),
    (d = r.request).tokenName && ((l = {})[d.tokenName] = layui.data(r.tableName)[d.tokenName] || "",
    a.set({
        headers: l,
        where: l
    }),
    n.set({
        headers: l,
        data: l
    })),
    e("admin", _)
});
